<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('project_capitalizes', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('project_id')->default(0);
            $table->unsignedDecimal('amount', 15, 2)->default(0)->comment('合同金额');
            $table->unsignedDecimal('gap', 15, 2)->default(0)->comment('资金缺口');
            $table->unsignedInteger('usage_days')->default(0)->comment('使用（天）');
            $table->date('usage_start_date')->nullable()->comment('使用时间');
            $table->date('repayment_date')->nullable()->comment('还款时间');
            $table->unsignedDecimal('interest', 15, 2)->default(0)->comment('总利息');
            $table->string('remarks')->default('/')->comment('备注');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('project_capitalizes');
    }
};
